﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Data.SqlServerCe;
using System.Data;
using EMR_System.Data;

namespace EMR_System
{
    class EMRSystem
    {
        public string HospitalName { get; set; }

        public static bool Login(User user)
        {
            return DatabaseSupport.Login(user);
        }

        public static bool Logoff()
        {
            Session.Instance.User = null;
            return true;
        }

        public static List<User> GetDoctors()
        {
            return DatabaseSupport.GetUserList(3);
        }

        public static User GetUser(string username)
        {
            return DatabaseSupport.GetUser(username);
        }

        public static int AddPatient(Patient patient)
        {
            return DatabaseSupport.CreatePatient(patient);
        }

        public static Patient GetPatient(int ID)
        {
            return DatabaseSupport.GetPatient(ID);
        }

        public static List<Patient> GetPatients()
        {
            return DatabaseSupport.GetPatientList();
        }

        public static bool UpdatePatient()
        {
            return DatabaseSupport.UpdatePatient();
        }

        public static Patient DeletePatient()
        {
            return DatabaseSupport.DeletePatient();
        }

        public static int ScheduleAppointment(Appointment appointment)
        {
            return DatabaseSupport.CreateAppointment(appointment);
        }

        public static Appointment SelectAppointment(int ID)
        {
            return DatabaseSupport.GetAppointment(ID);
        }

        public static List<Appointment> GetAppointments(DateTime date, bool searchFuture)
        {
            return DatabaseSupport.GetAppointmentList(date, searchFuture);
        }

        public static bool UpdateAppointment()
        {
            return DatabaseSupport.UpdateAppointment();
        }

        public static Appointment DeleteAppointment()
        {
            return DatabaseSupport.DeleteAppointment();
        }

        public static int CreateNote(int Type, int ApptID)
        {
            return DatabaseSupport.AddNote(Type, ApptID);
        }

        public static bool EnterVitals(int NoteID, Vitals v)
        {
            return DatabaseSupport.AddVitals(NoteID, v);
        }

        public static bool EnterComplaint(int NoteID, string complaint)
        {
            return DatabaseSupport.AddComplaint(NoteID, complaint);
        }
    }
}
